class Job < ActiveRecord::Base

  self.per_page = 10

  validates :position, presence: true
  validates :location, presence: true
  validates :content,  presence: true

  scope :by_created_at_desc, ->  { order('created_at desc') }

  scope :chinese, ->  { where(language: 1) }

  scope :english, -> { where(language: 2) }

  scope :traditional, ->  { where(language: 3) }

  scope :language, -> (language) { where(language: language) }

end
